<?php $this->renderPartial('_tabs'); ?>
<div>
	<div class="main-title no-border clearfix">
		<h1 class="float-left">Course Attendence needs approve</h1>
		<div class="clear"></div>
	</div>

	<div class="grid_16">
		<div class="grid-filter-menu">
			<?php
			$this->widget('zii.widgets.CMenu', array(
				'items' => array(
					array(
						'label' => 'Pending Access',
						'url' => $this->createUrl('/cpd/course/courseAttendenceAccess', array('is_approved' => 0)),
					),
					array(
						'label' => 'Rejected',
						'url' => $this->createUrl('/cpd/course/courseAttendenceAccess', array('is_approved' => 1)),
					),
					array(
						'label' => 'Approved',
						'url' => $this->createUrl('/cpd/course/courseAttendenceAccess', array('is_approved' => 2)),
					),
				))
			);
			?>
		</div>

		<?php
		$form = $this->beginWidget('GxActiveForm', array(
			'id' => 'bulk-approve-attendence',
			'action' => array('/cpd/course/approveAccessAttendence'),
		));
		?>

		<?php
		$this->widget('PsGridView', array(
			'id' => 'course-grid',
			'dataProvider' => $dataProvider,
			'filter' => $model,
			'template' => '{pager}{pagesize}{items}',
			'columns' => array(
				'course_name',
				'course_provider_name',
//			'description',
				array(
					'header' => 'Core CPD Hours',
					'name' => 'core_cpd_hour',
					'htmlOptions' => array(
						'class' => 'align-center',
						'width' => 100
					),
				),
				array(
					'header' => 'Non Core CPD Hours',
					'name' => 'non_core_cpd_hour',
					'htmlOptions' => array(
						'class' => 'align-center',
						'width' => 100
					),
				),
				array(
					'name' => 'course_completed_date',
					'htmlOptions' => array(
						'class' => 'align-center',
						'width' => 70
					),
				),
				array(
					'header' => 'Agent Name',
					'value' => '$data->user->name',
					'htmlOptions' => array(
						'class' => 'align-center',
						'width' => 100
					),
				),
				'id' => array(
					'class' => 'CCheckBoxColumn',
					'name' => 'id',
					'value' => '$data->id',
					'selectableRows' => 2,
					'checkBoxHtmlOptions' => array(
						'name' => 'id[]',
//						'disabled' => '($data->approval_status == CourseAttendence::APPROVAL_STATUS_PENDING)?"":"disabled"'
					),
					'visible' => ($_GET['is_approved'] != CourseAttendence::APPROVAL_STATUS_REJECTED) && ($_GET['is_approved'] != CourseAttendence::APPROVAL_STATUS_APPROVED),
					'htmlOptions' => array(
						'width' => 16,
					),
				),
			),
		));
		?>
		<?php if ($_GET['is_approved'] != 1): ?>
			<div id="">
				<label for="bulk_approve_attendence">Select items</label>
				<?php
				echo GxHtml::dropDownList('action', '', array(
					'approve' => 'Approved',
					'reject' => 'Rejected'
						), array('prompt' => 'Bulk Actions...'));
				?>
				<?php echo CHtml::submitButton(); ?>
				<?php // echo GxHtml::submitButton(Yii::t('app', 'Approve'), array('class' => '', 'name' => 'bulk_attendence_approve')); ?>
			</div>
		<?php endif; ?>
		<?php $this->endWidget(); ?>
	</div>

</div>